package com.xique.door.project.miniprogram.controller;

import com.xique.common.core.web.domain.AjaxResult;
import com.xique.door.project.miniprogram.bean.request.MiniBaseUserRequest;
import com.xique.door.project.miniprogram.bean.vo.MiniBaseUserVO;
import com.xique.door.project.miniprogram.service.IMiniBaseUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/baseUser")
public class MiniBaseUserController {
    @Autowired
    private IMiniBaseUserService miniBaseUserService;

    @GetMapping("/details")
    public AjaxResult selectBaseUserById() {
        return AjaxResult.success(miniBaseUserService.selectBaseUserById());
    }


    @GetMapping("/modify")
    public AjaxResult updateBaseUser(@Valid MiniBaseUserRequest miniBaseUserRequest) {

        return AjaxResult.success(miniBaseUserService.updateBaseUser(miniBaseUserRequest));
    }

}
